package com.snack.system.controller;

import com.snack.common.core.web.controller.BaseController;
import com.snack.common.core.web.domain.AjaxResult;
import com.snack.system.service.ITsResourceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 资源Controller
 * 
 * @author snack
 * @date 2022-09-18
 */
@RestController
@RequestMapping("/resource")
public class TsResourceController extends BaseController
{
    @Autowired
    private ITsResourceService resourceService;


    /**
     * 获取资源详细信息
     */
    @GetMapping(value = "/{resourceId}")
    public AjaxResult getInfo(@PathVariable("resourceId") Long resourceId)
    {
        return AjaxResult.success(resourceService.selectById(resourceId));
    }

    /**
     * 获取资源详细信息
     */
    @GetMapping(value = "/pics/{pics}")
    public AjaxResult getInfoByPics(@PathVariable("pics") String pics)
    {
        return AjaxResult.success(resourceService.selectListByPics(pics));
    }
}
